package com.qf.domain;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

public class Answers {
//    @NotNull(message = "id不能为空")
    private Integer id;
    @NotNull(message = "ansContent不能为空")
    private  String ansContent; //答题内容
//    @NotNull(message = "id不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date ansDate;
//    @NotNull(message = "qid不能为空")
    private Integer qid; //问题id

    public Answers() {
    }

    public Answers(Integer id, String ansContent, Date ansDate, Integer qid) {
        this.id = id;
        this.ansContent = ansContent;
        this.ansDate = ansDate;
        this.qid = qid;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAnsContent() {
        return ansContent;
    }

    public void setAnsContent(String ansContent) {
        this.ansContent = ansContent;
    }

    public Date getAnsDate() {
        return ansDate;
    }

    public void setAnsDate(Date ansDate) {
        this.ansDate = ansDate;
    }

    public Integer getQid() {
        return qid;
    }

    public void setQid(Integer qid) {
        this.qid = qid;
    }

    @Override
    public String toString() {
        return "answers{" +
                "id=" + id +
                ", ansContent='" + ansContent + '\'' +
                ", ansDate=" + ansDate +
                ", qid=" + qid +
                '}';
    }
}
